Skip to content

fix(web): a refused desktop install shows as failed instead of downloaded - #41262

Merged
juliusmarminge merged 2 commits into
mainfrom
factory/issue-38217-a1795412012
Nov 23, 2026
Merged

juliusmarminge merged 2 commits into
mainfrom
factory/issue-38217-a1795412012

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

On macOS, when the user cancels or is not allowed the admin prompt that installing an update needs, T3 Code acted as if the restart had worked. The update still showed as ready to install, and the "update everything" capsule sat on "Restarting…" with nothing to click. Now the failure is shown and the user can try the restart again.

  • getDesktopUpdateButtonTooltip shows "Install failed for {version}. Click to retry." when the desktop has returned to downloaded after a failed install, as it already does for failed downloads.
  • New installDesktopUpdate keeps listening after an accepted install for the failure the desktop reports later. The sidebar pill, update-everything, the track-switch dialog and Settings use it, so they show "Could not install update" and end their pending restart.

Fixes #38217

Reproduction on main

Commit 0356d68 (origin/main). On a pool Mac (macOS 26, Apple silicon): downloaded the signed T3-Code-0.1.12-nightly.20261122.5111-arm64.zip release, extracted it into a work directory and made the bundle root-owned (sudo chown -R root:wheel) so Squirrel.Mac must ask for admin authorization to install, then launched it with T3CODE_HOME pointed at an isolated directory and --remote-debugging-port to drive it. The app offered 0.1.12-nightly.20261123.5124; downloaded it via the desktop bridge (status downloaded). Attempt 1: Settings > About > Install > Confirm. Attempt 2: turned off the Codex and Claude providers in that isolated home (so the sidebar pill becomes the plain single-app install instead of 'Update this app and 2 providers', which would have updated the shared Mac's global CLIs), then clicked the sidebar pill 'Update 0.1.12-nightly.20261123.5124 downloaded. Click to restart and install.' > Confirm. Both times the desktop log shows electron-updater re-checking, Squirrel.Mac downloading, then an error event The operation couldn't be completed. (OSStatus error -60007.) (errAuthorizationInteractionNotAllowed: no prompt can show for an app launched over SSH; a user cancelling the prompt fails on the same privileged-ShipIt launch path, -60006). It was logged as 'Desktop updater install operation reported an error.' within about a second. The desktop recovered (window kept, backends restarted, state {status: downloaded, errorContext: install, canRetry: true, message set}), but the UI showed no error: no toast, Settings still said 'Update available.' with Install, and the pill still said 'downloaded. Click to restart and install.' The second attempt failed the same way, also silently. The real cancelled prompt was not seen (nobody can click on the pool Mac). The 'Update this app and N providers' flow was not run on the Mac to avoid changing the shared Mac's CLIs; from code, useUpdateEverything returns once installLocal resolves true and leaves the run in phase 'installing', so the capsule shows 'Restarting…' with no action. A failing unit test is on factory/repro-38217.

Evidence

Environment: macOS 26.6.2 arm64, light theme, 1100×780. Separate commit builds and fresh isolated homes; providers disabled. Each commit's rebuilt app.asar ran in the nightly release's signed native shell, with the bundle root-owned. Both sides downloaded the real nightly update and encountered OSStatus -60007 twice.

Steps: Settings > About > Install > Confirm; wait for failure recovery; close Settings; sidebar update control > Confirm to retry in the same session; hover the control after recovery. The unrelated local CLI path is masked.

Before After
0356d68835 220aa2374b
Before: Settings install failure is silent After: Settings reports install failure
Before: sidebar still claims the update is downloaded After: sidebar says install failed and offers retry
Before interaction recording After interaction recording

Base Settings failed silently; head showed 'Could not install update'. The base sidebar retry did show an error toast in this run, but retained the misleading downloaded label. Head reported the failure and changed the label to 'Install failed … Click to retry'.

UI driver · Bundle assembly and isolated seed script · Runtime errors and matching payload hashes · Before transcript · After transcript

Not shown:

  • A person cancelling the administrator prompt (-60006) was not exercised; the real SSH-launched authorization refusal (-60007) was exercised on both commits.
  • The update-everything flow with provider updates was not exercised because it would update the shared Mac's global provider CLIs.

Tests

  • vp test run src/components/desktopUpdate.logic.test.ts (apps/web) on the repro commit without the fix: 1 failed (the repro test: got 'Update 1.1.0 downloaded. Click to restart and install.')
  • vp test run src/components/desktopUpdate.logic.test.ts (apps/web) with the fix: 11 passed
  • vp run check:changed: format, lint, knip, typecheck (2 packages), tests (3 files, 32 passed), react compiler all pass
  • PR CI at 220aa23: all 40 checks passed

Not in this change

  • Settings > About still says 'Update available.' next to Install after a failed install; it says the same for the existing status 'error' install failure, and the tooltip now carries the failure.
  • The desktop does not clear errorContext 'install' when a retry starts, so a stale-feed retry can briefly re-emit the old failure; the web ignores states sent before the call returns.
  • The boot error screen's install button (apps/web/src/lib/bootError.ts) still calls bridge.installUpdate directly and does not wait for a later macOS refusal.

Who did the work

  • Written by Claude Opus 5.5, in Claude Code
  • Reviewed by GPT-6.1 Sol, in Codex, and by Claude Opus 5.5, each on its own
  • Proof captured by GPT-6.1 Sol and checked by Claude Opus 5.5

Run by the t3code factory in T3 Code.

juliusmarminge and others added 2 commits November 23, 2026 05:48
Repro for #38217.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…aded

On macOS a cancelled or refused install authorization reaches the desktop
as an updater error after installUpdate already returned accepted. The
desktop recovers to status "downloaded" with errorContext "install", but
the web showed that as a fresh download and treated the restart as done.

- The update tooltip says "Install failed … Click to retry." for that state.
- installDesktopUpdate waits for that later failure after an accepted
  install, so the sidebar, update-everything and Settings report it and
  end their pending restart instead of showing "Restarting…" forever.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Nov 23, 2026
@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The desktop update flow now waits for delayed install errors after an accepted install request. The settings and sidebar flows use the shared install wrapper, and downloaded updates with install errors show a retry tooltip.

Changes: Desktop update installation

Layer / File(s) Summary
Wait for install failure state
apps/web/src/components/desktopUpdate.logic.ts, apps/web/src/components/desktopUpdate.logic.test.ts
The shared wrapper waits for install-error state events after an accepted, incomplete install. The downloaded-update tooltip shows an install-failure retry message when the error context is install. Tests cover the delayed error result and listener cleanup.
Use shared install handling
apps/web/src/components/settings/SettingsPanels.tsx, apps/web/src/components/sidebar/SidebarUpdatePill.tsx
Both UI flows use the shared wrapper. Settings displays an error toast when the result contains an action error; the sidebar retains its existing result and error handling.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Possibly related issues

  • pingdotgg/t3code#14905: The PR handles the delayed install-error reporting described in the issue, but does not address the issue’s .deb relaunch cause.
  • pingdotgg/t3code#40605: The PR handles the accepted-then-later-failure path described in the issue, but does not address the proxy or Squirrel connection-loss cause.

Suggested reviewers: maria-rcks, macroscopeapp

Merge Risk: Minimal · up to 220aa

This change makes a failed macOS update install show as a failure and allows a retry, in the sidebar and in Settings. No actionable merge-blocking risk remains. A narrow timing edge case is known but low impact, and restarting the app recovers from it.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "fix(web): a refused desktop install shows as failed instead of downloaded" matches the main change. The PR makes a refused macOS install show as a failure. The title follows the conventiona…
Linked Issues check Passed Issue #38217 requires that a failed macOS install restart is reported as a failure and that the user can retry. The diff in apps/web/src/components/desktopUpdate.logic.ts meets this. (1) getDesktopUpd…
Out of Scope Changes check Passed All changes support the objective of surfacing macOS install-refusal failures. The tooltip change in desktopUpdate.logic.ts, the installDesktopUpdate wrapper, its adoption in SettingsPanels.tsx and Si…
Description check Passed The description covers the problem (macOS admin prompt cancelled or refused, so a failed install looked like a successful restart), the change (tooltip retry message, new installDesktopUpdate wrapper …
Full details: Title check

Explanation

The title "fix(web): a refused desktop install shows as failed instead of downloaded" matches the main change. The PR makes a refused macOS install show as a failure. The title follows the conventional commit format the template requests and is specific enough to scan history.

Full details: Linked Issues check

Explanation

Issue #38217 requires that a failed macOS install restart is reported as a failure and that the user can retry. The diff in apps/web/src/components/desktopUpdate.logic.ts meets this. (1) getDesktopUpdateButtonTooltip returns "Install failed for {version}. Click to retry." when status is downloaded, errorContext is install, and downloadedVersion is set. (2) The new installDesktopUpdate subscribes to onUpdateState before calling installUpdate. After an accepted, non-completed result with no action error, it waits for a later state with errorContext install and returns that state in the result. The subscription is removed in finally. The PR description and raw summary state that the sidebar pill, update-everything, track-switch dialog, and Settings call this wrapper and show the error toast. The changed call sites in SettingsPanels.tsx and SidebarUpdatePill.tsx are consistent with that. Unit tests cover the tooltip and the refused-install path. Residual risk: awaitingFailure is set only after installUpdate resolves. An install error emitted before the RPC result returns would be ignored, and the wrapper would wait without a later event. The PR's repro shows the error arrives about one second after the attempt, so the ordering appears safe, but no test covers this ordering. The real-app evidence section is still pending.

Full details: Out of Scope Changes check

Explanation

All changes support the objective of surfacing macOS install-refusal failures. The tooltip change in desktopUpdate.logic.ts, the installDesktopUpdate wrapper, its adoption in SettingsPanels.tsx and SidebarUpdatePill.tsx, and the test additions in desktopUpdate.logic.test.ts are direct parts of this fix. The PR description lists the Settings About status text, the stale errorContext on retry, and the boot error screen install button as deliberately not changed. None of these are changes in the diff, so they are not out-of-scope changes. The diff summary shows no unrelated modifications.

Full details: Description check

Explanation

The description covers the problem (macOS admin prompt cancelled or refused, so a failed install looked like a successful restart), the change (tooltip retry message, new installDesktopUpdate wrapper used by sidebar, update-everything, track-switch and Settings), a linked issue (#38217), a detailed reproduction on main, before/after evidence with screenshots and recordings, and test commands with results. It follows the template's Problem, Change, Scope, Verification sections and names the model and harness used. The minor gaps are that the title is not in the template's conventional-commit form in the body, and that the Scope section does not explain why a bug fix needs no issue, which is not required because an issue is linked.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between b1ce608 and 220aa23.

Files selected for processing: 4

  • apps/web/src/components/desktopUpdate.logic.test.ts
  • apps/web/src/components/desktopUpdate.logic.ts
  • apps/web/src/components/settings/SettingsPanels.tsx
  • apps/web/src/components/sidebar/SidebarUpdatePill.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.

@juliusmarminge
juliusmarminge merged commit 10765a4 into main Nov 23, 2026
41 checks passed
@juliusmarminge
juliusmarminge deleted the factory/issue-38217-a1795412012 branch November 23, 2026 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Failed update restart reports as completed

1 participant